<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>函数当中的严格模式</title>
  </head>
  <body>
    <input type="text" name="age" />
    <button id="msg"></button>
    <script>
      // 展开语法
      let { gender, age } = { gender: "man", age: 18 };
      console.table({ gender, age });

      function show1() {
        "use strict"; // 严格模式 use strict的作用域是从当前作用域及其子作用域受影响
        let show1Name = "show1";
        console.log(show1Name);
        function show11() {
          let show11Name = "show11";
          console.log(show11Name);
        }
        show11();
      }
      show1();

      let a = 1,
        b = "1";
      console.log(typeof a);
      console.log(typeof b);
      console.log(a == b); // true 底层会转换成类型再比较
      console.log(a === b); // false 完全比对，不转类型

      let span = document.querySelector("#msg");
      //    keyup 事件在按键被松开时触发。
      document
        .querySelector('[name="age"]')
        .addEventListener("keyup", function () {
          msg = "";
          if (this.value > 100) {
            msg = "年龄太大";
          }
          span.innerHTML = msg;
        });
    </script>
  </body>
</html>
